package com.rany.day04.demo04;

public class Computer {

    public void powerOn(){
        System.out.println("笔记本开机");
    }

    public void powerOf(){
        System.out.println("笔记本关机");
    }

    public void useDrive(USB usb){
        usb.open();
        if (usb instanceof Mouse){
            Mouse mouse = (Mouse) usb;
            mouse.click();
        }else {
            KeyBoard keyBoard = (KeyBoard) usb;
            keyBoard.type();
        }
        usb.close();
    }
}
